package com.teemor.common.datasource.service.impl;

import com.teemor.common.bean.datasource.input.QryArticlesIPo;
import com.teemor.common.bean.datasource.output.QryArticlesOPo;
import com.teemor.common.bean.model.EsOutputModel;
import com.teemor.common.bean.model.EsQueryModel;
import com.teemor.common.bean.utils.tmpl.BaseController;
import com.teemor.common.datasource.remote.IEsRemoteInterface;
import com.teemor.common.datasource.service.IArticleSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description:
 * @author zhoulk
 * @date: 2019/11/27
 */
@Service
public class ArticleSearchServiceImpl extends BaseController implements IArticleSearchService {

    @Autowired
    private IEsRemoteInterface iEsRemoteInterface;


    @Override
    public void flush(String index) {
        iEsRemoteInterface.flush(index);
    }

    @Override
    public EsOutputModel<QryArticlesOPo> searchArticles(EsQueryModel<QryArticlesIPo> inParam) {
        return iEsRemoteInterface.multiMatchQuery(inParam, QryArticlesOPo.class);
    }
}

